const { Model } = require('../index');

class Stock extends Model {
    static get tableName() {
        return 'stock';
    }

    static get relationMappings() {
        return {
            // Create a mapping with the user model
            //  A stock maps to many user_stock
            user_stock: {
                relation: Model.HasManyRelation,
                modelClass: `${__dirname}/user_stock.js`,
                // Where the two are joined
                join: {
                    from: 'stock.id',
                    to: 'user_stock.stockId'
                }
            },
           
        };
    }
}

module.exports = Stock;
//a = u.tableName;